home *** CD-ROM | disk | FTP | other *** search
- {###############################################################################}
- {# #}
- {# This program tests the Array Package #}
- {# #}
- {###############################################################################}
-
- program AryTest(input, output);
-
- uses Macintf, Arrays;
- type
- BigPtr = ^BigRec;
- BigRec = record
- r : real;
- r2 : real;
- other : array[1..20] of Longint;
- end;
- var
- myArray : handle;
- i : longint;
- Big : BigRec;
- x : integer;
- StackMark : integer;
- begin
- SetApplLimit(Pointer(Ord4(@StackMark) - Ord4(16000))); {16k stack}
- MaxApplZone;
-
- myArray := CreateNewArray(SizeOf(BigRec), 2000);
-
- writeln('Total Size of Record = ',SizeOf(BigRec));
- writeln('Total Size of the array = ',GetHandleSize(myArray));
- writeln;
- writeln('press mouse to start');
- repeat until button;
-
- for i := 0 to 2000 do
- begin
- Big.r := i / 1.0;
- SetElement(myArray, i, @Big);
- writeln(BigPtr(GetElement(myArray, i))^.r:7:2);
- end;
-
- DisposeArray(myArray);
- end.